home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group02b.txt / 000013_icon-group-sender_Mon Aug 19 12:51:00 2002.msg < prev    next >
Internet Message Format  |  2003-01-02  |  5KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id g7JJouc13314
  4.     for icon-group-addresses; Mon, 19 Aug 2002 12:50:56 -0700 (MST)
  5. Message-Id: <200208191950.g7JJouc13314@baskerville.CS.Arizona.EDU>
  6. From: Christopher Browne <cbbrowne@acm.org>
  7. X-Newsgroups: comp.lang.icon
  8. Subject: Re: What about "Expressions?" (was Re: Icon Wish List)
  9. Date: 17 Aug 2002 01:25:39 GMT
  10. X-Draft-From: ("nnvirtual:Languages" 619)
  11. X-Home-Page: http://www.cbbrowne.com/info/
  12. X-Emacs-Acronym: Experience the Mildest Ad Campaign ever Seen
  13. Microsoft: I'm not laughing anymore.
  14. X-Shopping-List: 
  15.    (1) Assiduous buds
  16.    (2) Presidential incongruous capture enemas
  17.    (3) Scrumptious erosion circumlocutions
  18. X-Uboat-Death-Message: TORPEDOED BY SALESMEN. UNABLE TO DIVE. SINKING. U-244.
  19. To: icon-group@cs.arizona.edu
  20. Errors-To: icon-group-errors@cs.arizona.edu
  21. Status: RO
  22.  
  23. The world rejoiced as Jesse Tov <tov@fas.harvard.REMOVE.edu> wrote:
  24. > Gene Kahn <jenjhiz@yahoo.com>:
  25. >> previous statements. On the other hand, in reading s-expression
  26. >> languages like Lisp and Scheme, I find that I have to hold in my mind
  27. >> too many _unstated_ intermediate results before I find what the
  28. >> expression is all about. (One could argue that this may be due more to
  29. >> bad code, i.e., irresponsible use of deep embedding, than to intrinsic
  30. >> properties of s-expressions).
  31. >
  32. > I would argue that it's bad code.  That's what "let" ("let"
  33. > in ML, "let*" in Scheme) is for.  (I don't know Lisp well
  34. > enough, but I bet there's something equivalent.)
  35.  
  36. Lisp was there first with LET and LET*.  The ML way is a bit more
  37. obviously expressive; code might assortedly look like:
  38.  
  39. (LET* ((A 1)
  40.        (B (* A 2)))
  41.    (+ A B))
  42.  
  43. which expands to
  44. (let ((a 1))
  45.    (let ((b (* a 2)))
  46.       (+ a b)))
  47.  
  48. which is rather like
  49.  
  50. let a = 1 
  51.   in let b = a * 2
  52.     in a + b;;
  53.  
  54. Contrast with
  55.  
  56. (let ((a 1)
  57.       (b 2))
  58.   (* a b))
  59.  
  60. which is like
  61.  
  62.   let a = 1 and b = 2 in a * b;;
  63.  
  64. >> Compare the readability of these chunks
  65. >> of code:
  66. >>
  67. >> FORTRAN-like
  68. >> The man kicked the dog.
  69. >> The dog chased the cat.
  70. >> The cat bit the mouse.
  71. >> The mouse died. 
  72. >> 
  73. >> LISP-like (in infix notation)
  74. >> The mouse the cat the dog the man kicked chased bit died.
  75. >
  76. > ML-like
  77. > The man kicked the dog
  78. > which chased the cat
  79. > which bit the mouse
  80. > which died.
  81. >
  82. > (OK, so "let" to "which" is sort of a stretch, but "which"
  83. > lets you stop remembering everything and encapsulate it as a
  84. > temporary variable, a "pronoun," if you will.  It makes the
  85. > sentence right-branching, and thus easier to read.)
  86. >
  87. >> Speaking of speaking (or writing) grammatical English, which skill has
  88. >> been implied in a recent post as a 'requisite' for programming, what
  89. >> do readers with good English grammar think of this sentence:
  90. >> grammatically correct or not? Be careful with your answer. Your
  91. >> reputation as a programmer is on the line.
  92. >> 
  93. >> The horse raced past the barn collapsed. 
  94. >
  95. > Well, I can't find any way to parse it that has the barn collapsing
  96. > rather than the horse.  In my dialect, it's is equivalent to
  97. >    The horse which was raced past the barn collapsed.
  98. > and is perfectly grammatical.  However, I know in some people's
  99. > dialects (my grandfather, from eastern Pennsylvania), it's more like:
  100. >    The horse which raced past the barn collapsed.
  101. > When I hear it like this, it's ungrammatical to me.
  102.  
  103. The problem here isn't grammar; it's semantics, and semantics that
  104. don't make sense.
  105.  
  106. If we changed the last word from "collapsed" to "upright", it would
  107. read:
  108.    The horse raced past the barn upright. 
  109.  
  110. The problem isn't with the barn; it's not with racing; its that if the
  111. horse is "collapsed," it doesn't make sense for it to be able to have
  112. "raced" past the barn.  Being in a state of collapse would generally
  113. _end_ any racing.
  114.  
  115. The sentence demonstrates why we have punctuation.  It makes a bit
  116. more sense (or at least the ambiguity of what "collapsed" attaches to
  117. gets broken a bit) if we add a comma:
  118.  
  119.    The horse raced past the barn, collapsed.
  120.  
  121. The problem with Perl is that it winds up slathering massive amounts
  122. of punctuation in everywhere, $whether @YOU %{want} $(it)++ or not.  
  123.  
  124. In human language, we want to have a _few_ accents here and there that
  125. break things up where they are needed.  A comma or two per line, a
  126. period in each sentence, and a colon or semicolon once in a while to
  127. indicate significant pauses.  Perl goes hogwild on punctuation, which
  128. gets really annoying after a while.  
  129.  
  130. That sample sentence probably needed an extra comma even though it
  131. wasn't strictly necessary in much the way that arithmetic operations
  132. often read much better with a few extra parentheses that allow the
  133. reader to avoid the need to puzzle through the specific order of
  134. bindings of arithmetic operations for the given language.
  135. -- 
  136. (concatenate 'string "cbbrowne" "@acm.org")
  137. http://www3.sympatico.ca/cbbrowne/spiritual.html
  138. This login session:  $13.99
  139.